import React, { useState } from "react";
import Taro from "@tarojs/taro";
import { View, Text, Image, Input } from "@tarojs/components";
import { AtIcon } from "taro-ui";
import NavigationBar from "../../NavigationBar/NavigationBar";
import NavigationPlace from "../../NavigationBar/NavigationPlace";
import globalStore from "../../state/globalData";
import "./searchRes.less";

const search = () => {
  const [inputval, setInputval] = useState("");

  const inputValue = value => {
    setInputval(value);
  };

  const toBack = () => {
    Taro.navigateBack({
      delta: -1
    });
  };

  const toHistory = ev => {
    console.log(ev);
  };

  const goSearch = () => {
    console.log(inputval);
  };

  const clearHis = () => {
    console.log("清除历史记录");
  };

  return (
    <View className="home-search-wrap">
      <NavigationBar
        canBack={() => toBack}
        navigationTitle="小米MIX 4"
        backgroundColor="#ffffff"
        button={true}
        buttonIconType="ri"
        buttonIcon="close-line"
        buttonIconSize="30rpx"
        buttonBGC="#00000000"
      />
      <NavigationPlace />
      <View className="search-title h-container">小米MIX 4</View>
      <View className="search-res-group">
        <View className="res-item">
          <Image mode="widthFix" src="" />
          <View className="product-title">
            <Text>行李箱包万向轮皮箱 abs拉杆箱20寸登机旅行箱包</Text>
          </View>
          <View className="product-price">
            <Text>￥12.80</Text>
          </View>
          <View className="product-old-price">￥12.90</View>
          <View className="product-add">
            <AtIcon
              prefixClass="ri"
              value="add-line"
              size="20"
              color="#fff"
            ></AtIcon>
          </View>
        </View>

        <View className="res-item">
          <Image mode="widthFix" src="" />
          <View className="product-title">
            <Text>行李箱包万向轮皮箱 abs拉杆箱20寸登机旅行箱包</Text>
          </View>
          <View className="product-price">
            <Text>￥12.80</Text>
          </View>
          <View className="product-old-price">￥12.90</View>
          <View className="product-add">
            <AtIcon
              prefixClass="ri"
              value="add-line"
              size="20"
              color="#fff"
            ></AtIcon>
          </View>
        </View>

        <View className="res-item">
          <Image mode="widthFix" src="" />
          <View className="product-title">
            <Text>行李箱包万向轮皮箱 abs拉杆箱20寸登机旅行箱包</Text>
          </View>
          <View className="product-price">
            <Text>￥12.80</Text>
          </View>
          <View className="product-old-price">￥12.90</View>
          <View className="product-add">
            <AtIcon
              prefixClass="ri"
              value="add-line"
              size="20"
              color="#fff"
            ></AtIcon>
          </View>
        </View>

        <View className="res-item">
          <Image mode="widthFix" src="" />
          <View className="product-title">
            <Text>行李箱包万向轮皮箱 abs拉杆箱20寸登机旅行箱包</Text>
          </View>
          <View className="product-price">
            <Text>￥12.80</Text>
          </View>
          <View className="product-old-price">￥12.90</View>
          <View className="product-add">
            <AtIcon
              prefixClass="ri"
              value="add-line"
              size="20"
              color="#fff"
            ></AtIcon>
          </View>
        </View>

        <View className="res-item">
          <Image mode="widthFix" src="" />
          <View className="product-title">
            <Text>行李箱包万向轮皮箱 abs拉杆箱20寸登机旅行箱包</Text>
          </View>
          <View className="product-price">
            <Text>￥12.80</Text>
          </View>
          <View className="product-old-price">￥12.90</View>
          <View className="product-add">
            <AtIcon
              prefixClass="ri"
              value="add-line"
              size="20"
              color="#fff"
            ></AtIcon>
          </View>
        </View>

        <View className="res-item">
          <Image mode="widthFix" src="" />
          <View className="product-title">
            <Text>行李箱包万向轮皮箱 abs拉杆箱20寸登机旅行箱包</Text>
          </View>
          <View className="product-price">
            <Text>￥12.80</Text>
          </View>
          <View className="product-old-price">￥12.90</View>
          <View className="product-add">
            <AtIcon
              prefixClass="ri"
              value="add-line"
              size="20"
              color="#fff"
            ></AtIcon>
          </View>
        </View>
      </View>
    </View>
  );
};

export default search;
